<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类选择器</title>
    <style>
        /*div >p:first-child{
            color: blue;
        }
        div >p:last-child{
            color: brown;
        }
        div >p:nth-child(3){
            color: darkgoldenrod;
        }*/
        div :last-of-type{
            color:red;
        }
    </style>
</head>
<body>
    <div>
        <p>内容一</p>
        <p>内容二</p>
        <p>内容三</p>
        <p>内容四</p>
        <p>内容五</p>
        <h2>标题1</h2>
        <h2>标题2</h2>
        <h2>标题3</h2>
    </div>
</body>
</html>